<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class SwtBjMachine extends Model
{
	use HasDateTimeFormatter;

    protected $table = 'swt_bj_machine';

    protected $guarded = [];
    protected $dates = ['last_online_time'];

    public function cabinet()
    {
        return $this->hasMany(SwtBjCabinet::class, 'bj_machine_id');
    }

    public function machine()
    {
        return $this->belongsTo(SwtMachine::class, 'machine_id');
    }
}
